package cn.tedu.spring.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    //1.简单类型属性值注入
    @Value("登录功能")
    private String name;
    //2.对象类型属性值注入
    /*
        Autowired注解：自动装配,注入对象和接口类型的数据;
          1.添加在属性上;
          2.添加在set方法上;
          3.添加在构造方法上.
     */
    @Autowired
    private UserDao userDao;

    @Override
    public String toString() {
        return "UserService{" +
                "name='" + name + '\'' +
                ", userDao=" + userDao +
                '}';
    }
}
